/**
 * Created by Administrator on 2017/3/2.
 */

/**
 * 登录验证
 * @param ctx
 * @param next
 * @returns {Promise.<void>}
 */
const fn_signin =async (ctx,next)=>{
    var email = ctx.request.body.email || "",
        password = ctx.request.body.password;
    if (email ==="chenjw@qq.com" && password ==="123456"){
        //登录成功
        ctx.render("signin_ok.html",{
            title:"登录成功！",
            name:email
        })
    }else{
        ctx.render("signin_failed.html",{
            title:"登录失败！"
        })
    }
}
/**
 * 导出方法
 * @type {{GET /: ((p1:*, p2:*))}}
 */
module.exports = {
    "POST /signin":fn_signin
}